<include file="public@header"/>
</head>
<body>
<div class="wrap">

    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('video/video/index')}">文件列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('video/video/index')}">
        日期：
        <input type="text" name="start_time" class="form-control" value="{$start_time}" placeholder="开始时间"
               autocomplete="off" id="startDate" style="width: 110px;">
        -
        <input type="text" name="end_time" class="form-control" value="{$end_time}" placeholder="结束时间"
               autocomplete="off" id="endDate" style="width: 110px;">
        班级：
        <select name="class_id" class="form-control">
            <option value="0">全部</option>
            <foreach name="class" item="vo" key="k">
                <php>$selected = $class_id == $k ? 'selected' : ''</php>
                <option value="{$k}" {$selected}>{$vo}</option>
            </foreach>
        </select>
        名字：
        <input class="form-control" type="text" name="name" style="width: 100px;" value="{$name}"
               placeholder="名字">
        任务：
        <input class="form-control" type="text" name="task" style="width: 100px;" value="{$task}"
               placeholder="任务">
        <input type="submit" class="btn btn-primary" value="搜索"/>

    </form>
    <table class="table table-hover table-bordered" style="table-layout:fixed;">
        <thead>
        <tr>
            <th>ID</th>
            <th>班级</th>
            <th>名字</th>
            <th>任务名</th>
            <th>文件</th>
            <th>上传时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.class_name}</td>
                <td>{$vo.name}</td>
                <td>{$vo.task}</td>
                <td><a href="{$vo.url}" download="{$vo.name}_{$vo.task}.mp3">点此下载</a></td>
                <td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
                <td>
                    <a class="btn btn-danger js-ajax-dialog-btn" href="{:url('delete',array('id'=>$vo['id']))}">删除</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<link rel="stylesheet" href="__STATIC__/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
<script src="__STATIC__/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer-v3.3.0/layer/layer.js"></script>
<script src="__STATIC__/js/pop_layer.js"></script>
<script>
    $("#startDate").datetimepicker({
        format: 'yyyy-mm-dd',
        minView: 'month',
        language: 'zh-CN',
        autoclose: true,
    }).on("click", function () {
        $("#startDate").datetimepicker("setEndDate", $("#endDate").val())
    });
    $("#endDate").datetimepicker({
        format: 'yyyy-mm-dd',
        minView: 'month',
        language: 'zh-CN',
        autoclose: true,
    }).on("click", function () {
        $("#endDate").datetimepicker("setStartDate", $("#startDate").val())
    });
</script>
</body>
</html>